import { Button } from 'antd'
import { memo, useEffect, useTransition } from 'react'

const Role = memo(() => {
	const [isPending, startTransition] = useTransition()

	useEffect(() => {
		console.log('enter: ', isPending)
		return () => {
			console.log('leave: ', isPending)
		}
	}, [isPending])

	const onClick = () => {
		startTransition(() => {
			console.log('=====')
		})
	}

	return (
		<Button type="primary" onClick={onClick}>
			按钮
		</Button>
	)
})

export default Role
